package main.java.com.leng.pojo.exception;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by presoul on 2017/6/10.
 */
public class UserException implements HandlerExceptionResolver {

    @Override
    public ModelAndView resolveException(HttpServletRequest httpServletRequest,
                                         HttpServletResponse httpServletResponse,
                                         Object o, Exception e) {

        ModelAndView mv = new ModelAndView();

        mv.addObject("error","未知异常");

        mv.setViewName("errror");

        return mv;
    }
}
